package org.example.authentication.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.authentication.pojo.SysPermissions;
import org.example.authentication.pojo.SysUser;

import java.util.Set;

public interface SysUserMapper extends BaseMapper<SysUser> {
    /**
     * 根据username获取角色列表
     *
     * @param username
     * @return 角色列表
     */
    Set<String> listRolesByName(@Param("username") String username);
    /**
     * 根据username获取权限列表
     *
     * @param username
     * @return 权限列表
     */
    Set<String> listPermsByName(@Param("username") String username);
    /**
     * 根据roleName获取权限列表
     *
     * @param roleName
     * @return 权限列表
     */
    Set<SysPermissions> listPermsByRoleName(@Param("roleName") String roleName);

    SysUser getUser(String username);
}
